﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NTTDATA.BEENChina.ResultCertification.Checker.Address
{
    public class AddressChecker
    {
        public  bool CheckPrefectureAndCity(string prefecture, string city, string shiteiToshi)
        {
            bool bresult = false;

            bresult = Logic.JaCitys.GetInstance().Citys.AsParallel().Any(
                 t => t.Type.Equals("p") &&
                 t.Name.Equals(prefecture) &&
                 t.ShiteiToshi.Equals(shiteiToshi)
                 );


            if (bresult)
            {
                bresult = Logic.JaCitys.GetInstance().Citys.AsParallel().Any(
                              t => t.Type.Equals("c") &&
                                   t.Name.Equals(city) &&
                                   t.ShiteiToshi.Equals(shiteiToshi)
                              );
            }

            return bresult;
        }
    }
}
